
import { createBrowserRouter,Navigate } from "react-router-dom";
import React,{ lazy } from "react";

import Fuwu from '../pages/KFR_pages/fuwu'
import Guah from '../pages/KFR_pages/guah'
import Ks_guah from '../pages/KFR_pages/ks_guah'
import Sou from '../pages/KFR_pages/sou'
import An_ks from '../pages/KFR_pages/an_ks'
import An_yy from "../pages/KFR_pages/an_yy";
import An_jb from '../pages/KFR_pages/an_jb'
import Yy_ys from "../pages/KFR_pages/yy_ys";

const router = createBrowserRouter([
    {path:'/fuwu',element:<Fuwu/>},
    {path:'/guah',element:<Guah/>},
    {path:'/ks_guah',element:<Ks_guah/>},
    {path:'/sou',element:<Sou/>},
    {path:'/an_ks',element:<An_ks/>},
    {path:'/an_yy',element:<An_yy/>},
    {path:'/an_jb',element:<An_jb/>},
    {path:'/yy_ys',element:<Yy_ys/>},
])



// 首页导航路由
const Home = lazy(() => import('../pages/Home'));
const Index = lazy(() => import('../pages/Index'));
const Find = lazy(() => import('../pages/Find'));
const Mind = lazy(() => import('../pages/Mind'));
const Shop = lazy(() => import('../pages/Shop'));
const Server = lazy(() => import('../pages/Server'));

// 首页其他选项路由
const Options = lazy(() => import('../pages/Options'))
const SelectDevice = lazy(() => import('../pages/SelectDevice'));
const ChangeCaed = lazy(() => import('../pages/ChangeCard'))
const Walk = lazy(() => import('../pages/Walk'))
const Weight = lazy(()=>import('../pages/Weight'))
const Sleep = lazy(()=>import('../pages/Sleep'))
const Heart = lazy(()=>import('../pages/Heart'))
const Run = lazy(()=>import('../pages/Run'))


//陈晓凡
import List from '../pages/CXF/list/List.jsx'
import Yxhw from '../pages/CXF/yxhw/Yxhw.jsx'
import Xpzq from '../pages/CXF/xpzq/Xpzq.jsx'
import Ydjs from '../pages/CXF/ydjs/Ydjs.jsx'
import Qbfl from '../pages/CXF/qbfl/Qbfl.jsx'
import Xq from '../pages/CXF/Xq/Xq.jsx'
import Xq1 from '../pages/CXF/Xq/Xq1.jsx'
import Xq3 from '../pages/CXF/Xq/Xq3.jsx'
import Chat from '../pages/CXF/chat/Chat.jsx'
import Ddqr from '../pages/CXF/Ddqr/Ddqr.jsx'
import Syt from '../pages/CXF/Syt/Syt.jsx'


import Wlgz from '../pages/CXF/Wlgz/Wlgz.jsx'
import Xzfw from '../pages/CXF/Xzfw/Xzfw.jsx'
import Sqtk from '../pages/CXF/Sqtk/Sqtk.jsx'
import Sqhh from '../pages/CXF/Sqhh/Sqhh.jsx'
import Sqthtk from '../pages/CXF/Sqthtk/Sqthtk.jsx'
import Tmj from '../pages/CXF/Tmj/Tmj.jsx'
import Hmj from '../pages/CXF/Hmj/Hmj.jsx'
import Tsj from '../pages/CXF/Tsj/Tsj.jsx'
import Hsj from '../pages/CXF/Hsj/Hsj.jsx'
import Hfh from '../pages/CXF/Hfh/Hfh.jsx'
import Hcg from '../pages/CXF/Hcg/Hcg.jsx'
import Tkcg from '../pages/CXF/Tkcg/Tkcg.jsx'
import Userlist from '../pages/CXF/UseList/index.jsx'
import chats from '../pages/CXF/Chats/index.jsx'

//秦久翔
import Guahao from "../pages/qjx/guahao";
import Tijian from "../pages/qjx/tijian";
import Wenzhen from "../pages/qjx/wenzhen";
import Qjx_mi from "../pages/qjx/qjx_mi";
import Qjx_cheng from "../pages/qjx/qjx_cheng";
import Yundong from "../pages/qjx/yundong";
import Y_zou from "../pages/qjx/y_zou";
import Y_shen from "../pages/qjx/y_shen";
import Y_yang from "../pages/qjx/y_yang";
import Y_fu from "../pages/qjx/y_fu";
import Y_adress from "../pages/qjx/y_adress";
import Q_ding from "../pages/qjx/q_ding";
import Qjx_j from "../pages/qjx/qjx_j";
import Qjx_yi from "../pages/qjx/qjx_yi";
import Qjx_gou from "../pages/qjx/qjx_gou";
import Qjx_tui from "../pages/qjx/qjx_tui";
import Qjx_gz from "../pages/qjx/qjx_gz";
import Qjx_huan from "../pages/qjx/qjx_huan";
import Qjx_hz from "../pages/qjx/qjx_hz";
const routes = [
    // 主路由 含有头部和导航
    {
        path: '/yxhw',
        element: <Yxhw></Yxhw>
    },
    {
        path: '/userlist',
        element: <Userlist></Userlist>
    },
    {
        path: '/xpzq',
        element: <Xpzq></Xpzq>
    },
    {
        path: '/ydjs',
        element: <Ydjs></Ydjs>
    },
    {
        path: '/qbfl',
        element: <Qbfl></Qbfl>
    },
    {
        path: '/xq',
        element: <Xq></Xq>
    },
    {
        path: '/xq1',
        element: <Xq1></Xq1>
    },
    {
        path: '/xq3',
        element: <Xq3></Xq3>
    },
    {
        path: '/chat',
        element: <Chat></Chat>
    },
    {
        path: '/ddqr',
        element: <Ddqr></Ddqr>
    },
    {
        path: '/syt',
        element: <Syt></Syt>
    },
    {
        path: '/wlgz',
        element: <Wlgz></Wlgz>
    },
    {
        path: '/xzfw',
        element: <Xzfw></Xzfw>
    },
    {
        path: '/sqtk',
        element: <Sqtk></Sqtk>
    },
    {
        path: '/sqthtk',
        element: <Sqthtk></Sqthtk>
    },
    {
        path: '/sqhh',
        element: <Sqhh></Sqhh>
    },
    {
        path: '/tmj',
        element: <Tmj></Tmj>
    },
    {
        path: '/hmj',
        element: <Hmj></Hmj>
    },
    {
        path: '/hfh',
        element: <Hfh></Hfh>
    },
    {
        path: '/hcg',
        element: <Hcg></Hcg>
    },
    {
        path: '/tsj',
        element: <Tsj></Tsj>
    },
    {
        path: '/hsj',
        element: <Hsj></Hsj>
    },
    {
        path: '/tkcg',
        element: <Tkcg></Tkcg>
    },
    {
        path: '/home',
        element: <Home />,
        children: [
            {
                path: 'mind',
                element: <Mind />,
            },
            {
                path: 'index',
                element: <Index />
            },
            {
                path: 'server',
                element: <Server />,
            },
            {
                path: 'find',
                element: <Find />
            },
            {
                path: 'shop',
                element: <Shop />,
                children: [
                    {
                        path: 'list',
                        element: <List></List>
                    },
                ]
            },
            {
                path: 'mind',
                element: <Mind />
            },

            {
                path: '',
                element: <Navigate to='/home/index' />
            }
        ]
    },
    // 其他路由
    {
        path: '/options',
        element: <Options />,
        children: [
            {
                // 选择设备
                path: 'selectDevice',
                element: <SelectDevice />
            },
            {
                // 编辑卡片
                path: 'cards',
                element: < ChangeCaed />
            },
            {
                path: 'run',
                element: <Run />
            },
            {
                path: 'walk',
                element: <Walk />
            },
            {
                path: 'weight',
                element: <Weight />
            },
            {
                path: 'sleep',
                element: <Sleep />
            },
            {
                path: 'heart',
                element: <Heart />
            },
        ]
    },


    {
        path: '/',
        element: <Navigate to='/home' />
    },
    {
        path: 'guahao',
        element: <Guahao />
    },
    {
        path: 'tijian',
        element: <Tijian />
    },
    {
        path: 'wenzhen',
        element: <Wenzhen /> 
    },
    {
        path: 'qjx_mi',
        element: <Qjx_mi /> 
    },
    {
        path: 'qjx_cheng',
        element: <Qjx_cheng />
    },
    {
        path: 'yundong',
        element: <Yundong /> 
    },
    {
        path: 'y_zou',
        element: <Y_zou /> 
    },
    {
        path: 'y_shen',
        element: <Y_shen />
    },
    {
        path: 'y_yang',
        element: <Y_yang />
    },
    {
        path: 'y_fu',
        element: <Y_fu /> 
    },
    {
        path: 'y_adress',
        element: <Y_adress />
    },
    {
        path: 'q_ding',
        element: <Q_ding /> 
    },
    {
        path: 'qjx_j',
        element: <Qjx_j /> 
    },
    {
        path: 'qjx_yi',
        element: <Qjx_yi /> 
    },
    {
        path: 'qjx_gou',
        element: <Qjx_gou /> 
    },
    {
        path: 'qjx_tui',
        element: <Qjx_tui />
    },
    {
        path: 'qjx_gz',
        element: <Qjx_gz /> 
    },
    {
        path: 'qjx_huan',
        element: <Qjx_huan /> 
    },
    {
        path: 'qjx_hz',
        element: <Qjx_hz />
    },
]
export default routes
